import {createRouter, createWebHashHistory} from 'vue-router'


const routes = [{
    name: 'home',
    path: '/',
    component: () => import('@/views/home/HomePage.vue')
},
    {
        name: 'member',
        path: '/member',
        /*会员中心组件*/
        component: () => import('@/views/member/MemberCenter.vue'),
        children: [
            {
                name: 'info',
                path: '/member/info',
                component: () => import('@/views/member/PersonalInfo.vue')
            },
            {
                name: 'modifyPassword',
                path: '/member/modify_password',
                component: () => import('@/views/member/ModifyPassword.vue')
            },
            {
                name: 'shoppingCart',
                path: '/member/shopping_cart',
                component: () => import('@/views/member/ShoppingCart.vue')
            },
            {
                name: 'myCollect',
                path: '/member/my_collect',
                component: () => import('@/views/member/MyCollect.vue')
            }, {
                name: 'myOrder',
                path: '/member/my_order',
                component: () => import('@/views/member/MyOrder.vue')
            }, {
                name: 'myAddress',
                path: '/member/my_address',
                component: () => import('@/views/member/MyAddress.vue')
            }
        ]
    }, {
        name: 'productDeatils',
        path: '/product/details/:id?',
        component: () => import('@/views/product/ProductDetails.vue')
    }, {
        name: 'productList',
        path: '/product/search',
        component: () => import('@/views/product/search/SearchMain.vue')
    }
    ,{
        name:'orderMain',
        path:'/order',
        component:()=>import('@/views/order/OrderMain.vue')
    },
    {
        name:'notFound',
        path:'/:pathMatch(.*)*',
        component:()=>import('@/views/common/NotFound.vue')
    }
];

const router = createRouter({
    history: createWebHashHistory(),
    routes
});

export default router